import random
num = random.randint(1, 101)
Num = input("请输入一个1至100的数字\n")
for i in range(1, 30):
    if not Num.isdigit():
        Num = input("请输入1至100的数字\n")
    else:
        if int(Num) < num:
            Num = input("你输入的数字小啦！请重新输入：\n")
        elif int(Num) > num:
            Num = input("你输入的数字大啦！请重新输入：\n")
        else:
            print("恭喜你猜对了")
            if i < 3:
                print("你是师傅")
                exit(0)
            elif i < 6:
                print("你是沙僧")
                exit(0)
            elif i >= 6:
                print("你是悟空")
                exit(0)
print("你已经没有机会啦！")